package org.witsoft.dtx.service;

import org.witsoft.dtx.domain.BranchStatus;
import org.witsoft.dtx.domain.BranchTransaction;

import java.util.List;

/**
 * @author XiaoQing Lin
 * @date 2020-09-18 20:41
 */
public interface BranchTransactionService {

    void add(BranchTransaction entity);

    void updateStatus(BranchTransaction entity);

    List<BranchTransaction> findByGid(String gid);

    List<BranchTransaction> findUnlockByStatus(BranchStatus status,  int size);

    boolean tryLock(String gid, String bid);

    boolean unlock(String gid, String bid);

    int releaseLockTimeout();

    int updateConfirmedToPrepare();
}
